<script>
import AMapLoader from "@amap/amap-jsapi-loader";

export default {
	data() {
		return {
			treeData: [],
			map:{}
		}
	},
	mounted() {
		this.initMap()
	},
	methods: {
		getTreeData() {
      this.$HttpService.get(`/t-district/findTreeAuth`).then(res => {
				this.treeData = res;
			})
		},
		initMap() {
			window._AMapSecurityConfig = {
				securityJsCode: "4b713bd5bb16f6957fc24d97522c60ed",
			};
			AMapLoader.load({
				key: "16ede9b4a69c1025eee7e093ec32d5b0", // 申请好的Web端开发者Key，首次调用 load 时必填
				version: "2.0", // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
				plugins: ["AMap.Scale"], // 需要使用的的插件列表，如比例尺'AMap.Scale'等
			}).then((AMap) => {
				this.map = new AMap.Map("container", {
					// 设置地图容器id
					viewMode: "3D", // 是否为3D地图模式
					zoom: 11, // 初始化地图级别
					center: [105.819212,28.044248], //地图中心点
				});
			}).catch((e) => {
				console.log(e);
			});
		}
	}
}
</script>

<template>
	<div class="map-out">
		<div id="container" style="width:100%; height: 100%;"></div>
	</div>
</template>

<style lang="scss" scoped>
.map-out {
	min-height: 600px;
	#container{
		width: 100%;
		min-height: 600px;
	}
}
</style>
